package cn.com.blueInfo.bpm.person.convert;

import cn.com.blueInfo.bpm.common.convert.BaseConvert;
import cn.com.blueInfo.bpm.person.entity.GroupInfo;
import cn.com.blueInfo.bpm.person.request.GroupInfoDTO;
import cn.com.blueInfo.bpm.person.response.GroupInfoVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * 群组信息表 对象转换
 * @author suxch
 * @since 2025-08-31 16:18:02
 */
@Mapper(componentModel = "spring")
public interface GroupInfoConvert
        extends BaseConvert<GroupInfo, GroupInfoDTO, GroupInfoVO> {

    GroupInfo dtoToEntity(GroupInfoDTO dto);

    GroupInfo dtoToEntity(GroupInfoDTO.UpdatePartialDTO dto);

    @Mapping(source = "status", target = "status", qualifiedByName = "enumToDesc")
    @Mapping(source = "deleted", target = "deleted", qualifiedByName = "enumToDesc")
    @Mapping(source = "groupType", target = "groupType", qualifiedByName = "enumToDesc")
    @Mapping(source = "formula", target = "formula", qualifiedByName = "enumToDesc")
    @Mapping(source = "async", target = "async", qualifiedByName = "enumToDesc")
    GroupInfoVO entityToVO(GroupInfo entity);

}